"use strict"
/**
 * @param {import("egg").Application} app
 */
module.exports = app => {
	const Sequelize = app.Sequelize
	const sequelize = app.model

	let userKfMsg = sequelize.define("user_kf_msg_view", {
		oid: {
			type: Sequelize.INTEGER,
		},
		create_at: {
			type: Sequelize.DATE,
			defaultValue: sequelize.literal("CURRENT_TIMESTAMP"),
			get() {
				return Date.parse(this.getDataValue("create_at"))
			},
		},
		respone_stat: {
			comment: "1已回,0未回",
			type: Sequelize.TINYINT,
		},
		msg: {
			type: Sequelize.STRING,
		},
		to_user: {
			comment: "// 客服为0 // 客服回复为来源的oid",
			type: Sequelize.INTEGER,
		}
	}, {
		tableName: "user_kf_msg_view",
		timestamps: false,
		deletedAt: false,
	})
	userKfMsg.sync({})
	return userKfMsg
}
